﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BusinessEntities.Model;
using System.Net.Mail;
using System.ServiceModel;
using BusinessEntities;

namespace YEMSBackendService
{
    [ServiceContract]
    [ServiceKnownType(typeof(Gift))]
    [ServiceKnownType(typeof(Cash))]
    [ServiceKnownType(typeof(Check))]
    [ServiceKnownType(typeof(GiftItem))]
    public interface IBLS
    {
        #region Security
        [OperationContract]
        int GetKey(string passcode);
        #endregion
        #region User Registration
        [OperationContract]
        ModelValidationReport<BusinessEntities.Model.User> LoginUser(string email, string password,string hash);
        [OperationContract]       
        string CreateActivationHash(User user,string hash);
        [OperationContract]
        User ValidateActivationHash(string hash, int userId,string hash1);
        [OperationContract]
        ModelValidationReport<User> CreateUser(User user,string hash);
        [OperationContract]
        User GetUserByID(int id,string hash);
        [OperationContract]
        User GetUserByEmail(string email,string hash);
        [OperationContract]
        void ResendActivationEmail(int userid,string hash);
        [OperationContract]
        List<User> GetAllUsers(string hash);
        [OperationContract]
        void DeleteUser(User user,string hash);
        [OperationContract]
        ModelValidationReport<User> UpdateUser(User user,string hash);
        #endregion
        
        #region Halls
        [OperationContract]
        Hall[] GetAllHalls(string hash);
        [OperationContract]
        Hall GetHallById(int id,string hash);
        #endregion

        #region Cities
        [OperationContract]
        List<City> GetCitiesByKeyWord(string keyWord,string hash);
        [OperationContract]
        City GetCityByName(string name,string hash);
        [OperationContract]
        City GetCityByID(int id,string hash);
        #endregion
        
        #region Events
        [OperationContract]
        ModelValidationReport<Event> CreateEvent(Event aEvent,string hash);
        [OperationContract]
        Event GetEventById(int id,string hash);
        [OperationContract]
        List<Event> GetUsersEvents(User user,string hash);
        [OperationContract]
        EventReport GetEventReport(Event aEvent,string hash);
        [OperationContract]
        void DeleteEvent(Event aEvent,string hash);
        [OperationContract]
        ModelValidationReport<Event> UpdateEvent(Event _event,string hash);
        #endregion

        #region Guests
        [OperationContract]
        Guest GetUsersGuestByEmail(string email, int userid,string hash);
        [OperationContract]
        List<Guest> GetUsersGuests(User user,string hash);
        [OperationContract]
        ModelValidationReport<Guest> CreateGuest(Guest guest,string hash);
        [OperationContract]
        Guest GetGuestByID(int id,string hash);
        [OperationContract]
        List<Invite> GetGuestsInvites(Guest g,string hash);
        [OperationContract]
        List<Guest> SearchForGuests(string keyword, int userid,string hash);
        [OperationContract]
        List<Guest> SearchForNonInvitedGuests(string keyword, int eventID, int p,string hash);
        [OperationContract]
        decimal GetAverageGuestGifts(Guest guest,string hash);
        #endregion

        #region Helpers
        [OperationContract]
        void SendMail(string toAddress,string body,string subject,string hash);
        #endregion

        #region Invites
        [OperationContract]
        ModelValidationReport<Invite> CreateInvite(Invite invite,string hash);
        [OperationContract]
        List<Invite> GetInvitesByEvent(Event ev,string hash);
        [OperationContract]
        Invite GetInviteByEventAndGuest(Event ev, Guest guest,string hash);
        [OperationContract]
        ModelValidationReport<Invite> UpdateInvite(Invite invite,string hash);
        [OperationContract]
        Invite GetInviteById(int id,string hash);
        [OperationContract]
        Invite GetInviteByHash(string hash,int guestID,string hash1);
        [OperationContract]
        bool DeleteInvite(int eventID, int inviteID, int guestID,string hash);
        #endregion
    }
}
